package Demo1299.Demo26;

import java.io.FileInputStream;
import java.lang.reflect.Field;
import java.util.Properties;

public class Demo1 {
    public static void main(String[] args) throws Exception {
        Properties prop = new Properties();
        FileInputStream in = new FileInputStream("C:\\Daymate\\src\\Demo1299\\Demo26\\data.properties");
        prop.load(in);
        in.close();
        Class<?> aClass = Class.forName("Demo1299.Demo14.User");
        Object User = aClass.getDeclaredConstructor().newInstance();
        Field uid = aClass.getDeclaredField("uid");
        uid.setAccessible(true);
        uid.set(User,prop.getProperty("uid"));
        Field username = aClass.getDeclaredField("username");
        username.setAccessible(true);
        username.set(User,prop.getProperty("username"));
        Field password = aClass.getDeclaredField("password");
        password.setAccessible(true);
        password.set(User,prop.getProperty("password"));
        System.out.println(User);
    }
}
